import Vue from "vue";
import "./plugins/element.js";
import router from "./router";

import App from "./App.vue";
import MyPage from "./components/MyPage.vue";
import { http } from "./http";
import "./assets/style/main.css";

Vue.config.productionTip = false;
Vue.prototype.$http = http;
Vue.component("my-page", MyPage);

Vue.mixin({
  computed: {
    uploadUrl() {
      return this.$http.defaults.baseURL + "/upload";
    },
  },
  methods: {
    getAuthHeaders() {
      return {
        Authorization: "Bearer " + (localStorage.token || ""),
      };
    },
  },
});

new Vue({
  router,
  render: (h) => h(App),
}).$mount("#app");
